﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ICollection<Person>>" %>
<%@ Import Namespace="NHATMSample.Models"%>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Html.Encode(ViewData["Message"]) %></h2>
    <p>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
        
        <% foreach (var p in Model) { %>
            Id: <%= p.Id %><br />
            Name: <%= p.Name %><br />
            Children:
            <ul>
                <% foreach (var c in (IEnumerable<Person>) p.Children ?? new HashSet<Person>()) { %>                 
                <li>
                    Id: <%= c.Id %><br />
                    Name: <%= c.Name %><br />
                </li>
                <% } %>
            </ul>
        <% } %>
    </p>
</asp:Content>